home *** CD-ROM | disk | FTP | other *** search
- Path: keats.ugrad.cs.ubc.ca!not-for-mail
- From: c2a192@ugrad.cs.ubc.ca (Kazimir Kylheku)
- Newsgroups: comp.lang.c
- Subject: Re: Question on stingizing
- Date: 4 Mar 1996 10:55:17 -0800
- Organization: Computer Science, University of B.C., Vancouver, B.C., Canada
- Message-ID: <4hfealINN5j9@keats.ugrad.cs.ubc.ca>
- References: <4hda43$f15@skivs.ski.org>
- NNTP-Posting-Host: keats.ugrad.cs.ubc.ca
-
- In article <4hda43$f15@skivs.ski.org>, Gemini Thunder <gt@ns.oon.or.jp> wrote:
- > I have looked over this problem, but can not figure out the why of
- >it. I don't have a copy of the Standard, but I have read the FAQ
- >(11.17), but it does not give the why of it either....
- > Why is this necessary:
- >
- >#define A Hello
- >#define s(x) #x
- >#define ss(x) s(x) /* why this circumvention for #defined ?? */
-
- So that if the argument is itself is a macro, it can be expanded:
-
- #define FOO abc
-
- s(FOO) -> "FOO"
- ss(FOO) -> s(abc) -> "abc"
- --
-
-